package frontend;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import logs.LogFactory;

import org.apache.log4j.Logger;

import backend.db.ORM;

/**
 * Servlet implementation class RemoveCourse
 */
public class RemoveCourse extends HttpServlet {
  private static final Logger logger = LogFactory.getLog(RemoveCourse.class);
  private static final long serialVersionUID = 1L;
  
  /**
   * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
   *      response)
   */
  @Override protected void doPost(final HttpServletRequest request, final HttpServletResponse response) {
    logger.debug("RemoveCourse");
    final String courseName = request.getParameter("courseName");
    ORM.removeCourse(courseName);
    logger.debug("course " + courseName + " removed");
  }
}
